<template>
  <basic-container>
    <avue-crud v-bind="bindVal"
               v-on="onEvent"
               :search.sync="searchParams"
               :page.sync="page"
               v-model="startForm">
      <template slot="menuBtn" slot-scope="{type,size,row}">
        <el-dropdown-item type="primary" size="small" icon="el-icon-plus"
                          v-if="getBtnPermission('addBtn',null,null,false)">新增数据表
        </el-dropdown-item>
        <el-dropdown-item type="primary" size="small" icon="el-icon-plus" @click.native="createCode(row)">生成代码
        </el-dropdown-item>
      </template>
    </avue-crud>
    <gen-code ref="genCode"></gen-code>
  </basic-container>
</template>

<script>
import startCrud from "@/mixins/start-crud.js"
import genCode from "./genCode.vue";

export default startCrud({
  name: "index",
  components: {
    genCode
  },
  watch: {
    'searchParams.dataSourcesKey': function (val) {
      this.refreshChange();
    }
  },
  methods: {
    createCode(row) {
      this.$refs.genCode.show(row);
    }
  }
}, {
  name: "codeGenerator/dataTable",
})
</script>

<style scoped>

</style>
